package com.jiayu.wheel.controller;

import com.alibaba.fastjson.JSONObject;
import com.jiayu.wheel.config.ApplicationConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author Administrator
 */
@Controller
public class WheelAction {

    @Autowired
    private ApplicationConfig applicationConfig;

    @RequestMapping(value = "/wheel")
    public String toWheel(){
        return "wheel";
    }

    @GetMapping("/environment/name")
    @ResponseBody
    public String getEnvironmentName(@RequestHeader(value = "token") String token){
        return applicationConfig.getName();
    }
}
